<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./Test.xhtml">
            <ui:define name="content">



                <p:dataTable var="item" value="#{contactBean.viewContact}"
                             paginator="true" rows="10"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="5,10,15"
                             selection="selectedAU"
                             selectionMode="single">
                    <f:facet name="header">
                        All Contact
                    </f:facet>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Contact Id" />
                        </f:facet>
                        <h:outputText value="#{item.ctID}" />
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="FirstName" />
                        </f:facet>
                        <h:outputText value="#{item.firstName}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="YourEmail" />
                        </f:facet>
                        <h:outputText value="#{item.yourEmail}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Message" />
                        </f:facet>
                        <h:outputText value="#{item.message}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="CtDate" />
                        </f:facet>
                        <h:outputText value="#{item.ctDate}" >
                            <f:convertDateTime pattern="MM/dd/yyyy" timeZone="VST"/></h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Status" />
                        </f:facet>
                        <h:outputText value="#{item.status}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Update" />
                        </f:facet>
                        <h:commandButton value="Update" action="updateContact" image="../resources/images/table/action_edit.gif">
                            <f:setPropertyActionListener value="#{item}"
                                                         target="#{contactBean.con}" />
                        </h:commandButton>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Delete" />
                        </f:facet>
                        <h:commandButton value="Delete" actionListener="#{contactBean.deleteContact(item)}" action="Contact" image="../resources/images/table/action_delete.gif"/>
                    </p:column>

                </p:dataTable>



            </ui:define>
        </ui:composition>

    </body>
</html>
